package com.xywy.wjk;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.xywy.R;
import com.xywy.common.BaseActivity;
import com.xywy.common.app.MainApplication;

public class WjkPopupActivity extends BaseActivity implements OnClickListener{
	private TextView tv_title;
	private TextView tv_content;
	private Button btn_cancle;
	private Button btn_confirm;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    	// TODO Auto-generated method stub
    	super.onCreate(savedInstanceState);
    	 setContentView(R.layout.tip_dialog_switch);
    	 preInit();
    	 initView();
    	 loadData();
    }
	@Override
	public void preInit() {
		// TODO Auto-generated method stub

	}

	@Override
	public void loadData() {
		// TODO Auto-generated method stub

	}

	@Override
	public void initView() {
        tv_title = (TextView) findViewById(R.id.title);
        tv_content = (TextView) findViewById(R.id.content);
        btn_cancle = (Button) findViewById(R.id.btn_cancle);
        btn_confirm = (Button) findViewById(R.id.btn_confirm);
        
        tv_title.setText("欢迎来到云健康");
        tv_content.setText("立即前往添加设备吧");
        
        btn_cancle.setOnClickListener(this);
        btn_confirm.setOnClickListener(this);
	}
	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.btn_cancle:
			finish();
			break;
		case R.id.btn_confirm:
			Intent intent = new Intent();
			intent.putExtra("confirm", 1);
			setResult(RESULT_OK, intent);
			finish();
			break;

		default:
			break;
		}
	}
	
	@Override
	protected void onDestroy() {
		MainApplication.setFirstOpenAPp(false);
		super.onDestroy();
	}

}
